package com.value.test.mybatis;

import com.value.mybatis.DaoRouter;
import com.value.mybatis.Pagination;
import com.value.test.mybatis.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by laborc on 2017/3/27.
 */
@Component
public class UserTester {
    public UserVO query() throws Exception {
        Pagination pagination = new Pagination();
        Map<String, Object> params = pagination.getParams();
        List<UserVO> userList1 = this.daoRouter.query("FscUser.loadElUser",pagination);
        params.put("schoolId",1);
        int count = this.daoRouter.count("FscUser.loadElUserForPage", params);
        List<UserVO> userList2 = this.daoRouter.query("FscUser.loadElUserForPage",pagination);
        count = this.daoRouter.count("FscUser.loadElUserForPage", params);
        userList2 = this.daoRouter.query("FscUser.loadElUserForPage",pagination);
        return  userList2.get(0);
    }
    @Autowired
    private DaoRouter daoRouter;
}
